import { StationVO } from '@/api/station/types';
import { VxeGridProps } from 'vxe-table';

export function getTableConfig(): VxeGridProps<StationVO> {
  return {
    id: 'tenant',
    loading: false,
    height: 'auto',
    autoResize: true,
    border: 'inner',
    resizable: true,
    showOverflow: 'tooltip',
    stripe: true,
    rowConfig: {
      isHover: true,
      keyField: 'id'
      // height: 56
    },
    customConfig: {
      storage: true
    },
    columns: [
      { title: '序号', type: 'seq', width: 50 },
      { sortable: true, field: 'name', title: '站房名称' },
      { sortable: true, field: 'regionName', title: '区域' },
      { sortable: true, field: 'status', title: '状态', slots: { default: 'status' }, width: 50  },
      { sortable: true, field: 'pressure', title: '压力(帕)' },
      { sortable: true, field: 'concentration', title: '浓度(%)' },
      { sortable: true, field: 'createTime', title: '创建时间' },
      { sortable: true, field: 'lastMaintenanceTime', title: '上次维保时间' },
      { sortable: true, field: 'operationalMode', title: '调试模式', slots: { default: 'mode' } },
      { sortable: true, field: 'handle', title: '操作', width: '140px', slots: { default: 'handle' } }
    ],
    data: [] as StationVO[]
  };
}
